package ezy.widget.view;

import android.content.Context;
import android.graphics.Canvas;
import android.util.AttributeSet;
import android.widget.RelativeLayout;

public class LabelField extends RelativeLayout {

    private LabelContext lc;
    public LabelField(Context context) {
        super(context);
        init(context, null);
    }

    public LabelField(Context context, AttributeSet attrs) {
        super(context, attrs);
        init(context, attrs);
    }

    public LabelField(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
        init(context, attrs);
    }

    private void init(Context context, AttributeSet attrs) {
        lc = new LabelContext(this, attrs);
    }

    @Override
    protected void drawableStateChanged() {
        super.drawableStateChanged();
        lc.drawableStateChanged();
    }

    @Override
    protected void onDraw(Canvas canvas) {
        lc.onDraw(canvas);
        super.onDraw(canvas);
    }
}